<script>
import {defineComponent} from 'vue'

export default defineComponent({
    name: "pageA",
    methods: {
        goB() {
            this.$router.push({
                path: '/pageB',
                query: {
                    id: 321
                }
            })
        },
        goC() {
            this.$router.push({
               name: 'pageC',
                params: {
                    id: 10086
                }
            })
        },
    }
})
</script>

<template>
    <div>
        pageA
        <router-link :to="{path:'/pageB',query:{id:123}}">点击跳转到B</router-link>
        <button @click="goB()">toB</button>
        <router-link :to="{name:'pageC',params:{id:123}}">点击跳转到C</router-link>
        <button @click="goC()">toC</button>
    </div>
</template>

<style scoped lang="less">

</style>